package com.yike.product.service.impl;

import com.yike.product.entity.GoodsPriceRecord;
import com.yike.product.mapper.GoodsPriceRecordMapper;
import com.yike.product.service.GoodsPriceRecordService;
import com.yike.product.param.GoodsPriceRecordPageParam;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yike.common.base.BaseServiceImpl;
import com.yike.common.pagination.Paging;
import com.yike.common.pagination.PageInfo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yike.product.vo.GoodsPriceRecordVo;
import org.springframework.transaction.annotation.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 商品价格记录 服务实现类
 *
 * @author Sakura
 * @since 2024-11-04
 */
@Slf4j
@Service
public class GoodsPriceRecordServiceImpl extends BaseServiceImpl<GoodsPriceRecordMapper, GoodsPriceRecord> implements GoodsPriceRecordService {

    @Autowired
    private GoodsPriceRecordMapper goodsPriceRecordMapper;

    @Override
    public Paging<GoodsPriceRecordVo> getGoodsPriceRecordPageList(GoodsPriceRecordPageParam goodsPriceRecordPageParam) throws Exception {
        Page<GoodsPriceRecord> page = new PageInfo<>(goodsPriceRecordPageParam);
        IPage<GoodsPriceRecordVo> iPage = goodsPriceRecordMapper.getGoodsPriceRecordList(page, goodsPriceRecordPageParam);
        return new Paging<GoodsPriceRecordVo>(iPage);
    }

}
